/* GUI CONVERTED from POPOIQ01.P (converter v1.75) Sun Aug 13 13:39:36 2000 */
/* POPOIQ01.P - PURCHASE ORDER RECEIPT DAILY REPORT AND INQUIRY             */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                      */
/* All rights reserved worldwide.  This is an unpublished work.             */
/* web convert POPOIQ01.P (converter v1.00) Mon Mar 09 15:48:49 1998        */
/* web tag in POPOIQ01.P (converter v1.00) Mon Mar 09 15:48:31 1998         */
/*F0PN*/ /*K1L3*/ /*                                                        */
/*V8:ConvertMode=Report                                                     */
/* REVISION: 1.0     LAST MODIFIED: 04/30/86    BY: PML */
/* REVISION: 2.1     LAST MODIFIED: 09/10/87    BY: WUG *A94* */
/* REVISION: 4.0     LAST MODIFIED: 01/05/88    BY: FLM *A108**/
/* REVISION: 4.0     LAST MODIFIED: 12/30/87    BY: WUG *A137**/
/* REVISION: 4.0     LAST MODIFIED: 07/19/87    BY: FLM *A334**/
/* REVISION: 5.0     LAST MODIFIED: 05/03/89    BY: WUG *B098**/
/* REVISION: 6.0     LAST MODIFIED: 05/24/90    BY: WUG *D002**/
/* REVISION: 6.0     LAST MODIFIED: 08/08/90    BY: RAM *D030**/
/* Revision: 7.3    Last edit: 11/19/92     By: jcd *G345* */
/* REVISION: 8.6E      LAST MODIFIED: 02/23/98   BY: *L007* A. Rahane */
/* REVISION: 8.6E      LAST MODIFIED: 03/09/98   BY: *K1L3* Beena Mol */
/* REVISION: 8.6E      LAST MODIFIED: 05/20/98   BY: *K1Q4* Alfred Tan   */
/* REVISION: 8.6E      LAST MODIFIED: 06/03/98   BY: *K1RS* A.Shobha     */
/* REVISION: 9.1       LAST MODIFIED: 03/24/00   BY: *N08T* Annasaheb Rahane */
/* REVISION: 9.1       LAST MODIFIED: 08/13/00   BY: *N0KQ* myb              */
/* REVISION: HK        LAST MODIFIED: 11/27/03   BY: *EEE* zyf              */

/*K1L3*/ /* DISPLAY TITLE */

/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

/*K1L3*/ {mfdtitle.i "b+ "}

/* ********** Begin Translatable Strings Definitions ********* */

&SCOPED-DEFINE popoiq01_p_1 "PO Cost"
/* MaxLen: Comment: */

&SCOPED-DEFINE popoiq01_p_2 "Qty"
/* MaxLen: Comment: */

/* ********** End Translatable Strings Definitions ********* */

define variable vend like po_vend.
define variable part like tr_part.
define variable ord like po_nbr.
define variable job like pod_so_job.
define variable site like pod_site.
define variable rcp_type like prh_rcp_type.

/*K1L3* /* DISPLAY TITLE */
 * {mfdtitle.i "b+ "}  */

part = global_part.

/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A

FORM /*GUI*/ 
   part
   vend
   ord
   job
   site
with frame a attr-space width 80 no-underline THREE-D /*GUI*/.

/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME

/* SET EXTERNAL LABELS */
setFrameLabels(frame a:handle).

/*K1L3*/ {wbrp01.i}

repeat:

/*K1L3*/ if c-application-mode <> 'web' then
   update part vend ord job site with frame a editing:

      if frame-field = "part" then do:
        /* FIND NEXT/PREVIOUS RECORD */
        {mfnp.i pt_mstr part pt_part part pt_part pt_part}
        if recno <> ? then do:
           part = pt_part.
           display part with frame a.
        end.
      end.
      else do:
        status input.
        readkey.
        apply lastkey.
      end.
   end.

/*K1L3*/ {wbrp06.i &command = update &fields = "  part vend ord job site" &frm = "a"}

/*K1L3*/ if (c-application-mode <> 'web') or
/*K1L3*/ (c-application-mode = 'web' and
/*K1L3*/ (c-web-request begins 'data')) then do:

   hide frame b.
   hide frame c.
   hide frame d.
   hide frame e.
   hide frame f.

/*K1L3*/ end.

   /* SELECT PRINTER */
   {mfselprt.i "terminal" 110}

   if vend <> "" then repeat for tr_hist with frame b width 110:

      /* SET EXTERNAL LABELS */
      setFrameLabels(frame b:handle).
        
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/
                 /*G345*/
      find prev tr_hist where (tr_addr = vend)
      and (tr_type = "RCT-PO" or tr_type = "ISS-PRV" or tr_type = "ISS-RV")
      and (tr_part = part or part = "" )
      and (tr_nbr = ord or ord = "" )
      and (tr_so_job = job or job = "" )
      and (tr_site = site or site = "")
      use-index tr_addr_eff
      no-lock.

      if tr_type matches "*RV" then rcp_type = "R".
      else rcp_type = "".

      display 
          tr_part 
          tr_um 
          tr_nbr format "X(8)"
          tr_line
          tr_effdate 
          tr_qty_loc 
          rcp_type 
          tr_ship_type 
          tr_trnbr 
          tr_so_job
          tr_site 
      WITH STREAM-IO /*GUI*/ .
   end.

   else if part <> "" then repeat for tr_hist with frame c width 110:

      /* SET EXTERNAL LABELS */
      setFrameLabels(frame c:handle).
        
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/
                 /*G345*/
      find prev tr_hist where tr_part = part
      and (tr_type = "RCT-PO" or tr_type = "ISS-PRV" or tr_type = "ISS-RV")
      and (tr_addr = vend or vend = "" )
      and (tr_nbr = ord or ord = "" )
      and (tr_so_job = job or job = "" )
      and (tr_site = site or site = "")
      use-index tr_part_eff
      no-lock.

      if tr_type matches "*RV" then rcp_type = "R".
      else rcp_type = "".

      display 
          tr_um 
          tr_nbr format "X(8)" 
          tr_line
          tr_addr
          tr_effdate 
          tr_qty_loc /*column-label {&popoiq01_p_2} */
          rcp_type
          /*tr_price column-label {&popoiq01_p_1} format "->>>>>>>>9.99"*/
          tr_ship_type 
          tr_trnbr 
          tr_so_job
          tr_site 
      WITH STREAM-IO /*GUI*/ .
   end.

   else if ord <> "" then repeat for tr_hist with frame d width 110:

        /* SET EXTERNAL LABELS */
      setFrameLabels(frame d:handle).
        
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/
                 /*G345*/
      find prev tr_hist where tr_nbr = ord
      and (tr_type = "RCT-PO" or tr_type = "ISS-PRV" or tr_type = "ISS-RV")
      and (tr_so_job = job or job = "" )
      and (tr_site = site or site = "")
      use-index tr_nbr_eff
      no-lock.

      if tr_type matches "*RV" then rcp_type = "R".
      else rcp_type = "".

      display 
          tr_part 
          tr_um 
          tr_line
          tr_addr
          tr_effdate 
          tr_qty_loc 
          rcp_type 
          tr_ship_type 
          tr_trnbr 
          tr_so_job
          tr_site 
      WITH STREAM-IO /*GUI*/ .
   end.

   else if job <> "" then repeat for tr_hist with frame e width 110:
      find prev tr_hist where tr_so_job = job
      and (tr_site = site or site = "")
      and (tr_type = "RCT-PO" or tr_type = "ISS-PRV" or tr_type = "ISS-RV")
      no-lock.

      if tr_type matches "*RV" then rcp_type = "R".
      else rcp_type = "".

      /* SET EXTERNAL LABELS */
      setFrameLabels(frame e:handle).
      
      display 
          tr_part 
          tr_um 
          tr_nbr format "X(8)"
          tr_line
          tr_addr
          tr_effdate 
          tr_qty_loc column-label {&popoiq01_p_2} 
          rcp_type
          tr_ship_type 
          tr_trnbr 
          tr_site 
      WITH STREAM-IO /*GUI*/ .
   end.

   else if site <> "" then repeat for tr_hist with frame f width 110:

      /* SET EXTERNAL LABELS */
      setFrameLabels(frame f:handle).
        
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/
                 /*G345*/
      find prev tr_hist where tr_site = site
      and (tr_type = "RCT-PO" or tr_type = "ISS-PRV" or tr_type = "ISS-RV")
      no-lock.

      if tr_type matches "*RV" then rcp_type = "R".
      else rcp_type = "".

      display 
          tr_part 
          tr_um 
          tr_nbr format "x(8)"
          tr_line
          tr_addr
          tr_effdate 
          tr_qty_loc column-label {&popoiq01_p_2} 
          rcp_type
          tr_ship_type 
          tr_trnbr 
          tr_so_job
      WITH STREAM-IO /*GUI*/ .
   end.

   else do:
      repeat for tr_hist with frame g width 110:

      /* SET EXTERNAL LABELS */
     setFrameLabels(frame g:handle).
        
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/
                 /*G345*/
     find prev tr_hist
     where (tr_type = "RCT-PO" or tr_type = "ISS-PRV" or tr_type = "ISS-RV")
     use-index tr_trnbr
     no-lock.

     if tr_type matches "*RV" then rcp_type = "R".
     else rcp_type = "".

     display 
         tr_part 
         tr_um 
         tr_nbr format "X(8)"
         tr_line
         tr_addr
         tr_effdate 
         tr_qty_loc column-label {&popoiq01_p_2} 
         rcp_type
         tr_ship_type 
         tr_trnbr 
         tr_so_job
         tr_site 
     WITH STREAM-IO /*GUI*/ .
   end.
 end.
   {mfreset.i}
/*GUI*/ {mfgrptrm.i} /*Report-to-Window*/

   {mfmsg.i 8 1}
end.
global_part = part.

/*K1L3*/ {wbrp04.i &frame-spec = a}
